<!--
Computer Science Course 531 - Introduction to Software Engineering
Olive Insurance Client Management System (Client Database Access)
Version 1.0 (Base System)
Spring 2011

-- Source Code Details --
Page Tile: reportDetails.php
Created By: David Gonzalez, Computer Science (Undergraduate)
Documented By: Darrius Serrant, Computer Science (Undergraduate)
Purpose: User interface allowing the user to generate different report types.
Status: In Process: Form generation functionality has not been implemented yet.

-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Report Generator:</title>
    </head>
    <h2>Report Generator:</h2>
    <body>
        <?php
        $display = "yes";
        require_once('connectvars.php');
        $display = "yes";
        if(isset($_COOKIE['user_name'])){
            if(isset($_POST['submit'])){
                foreach ($_POST['togenerate'] as $generate){
                    if($generate == "renewal"){
                        echo "Renewal Report Shown";
                    }
                    if($generate == "census"){
                        echo "Census Report Shown";
                    }
                    if($generate == "list"){
                        echo "Company List Report Shown";
                    }
                }
            }
        if(isset($_POST['back'])){
                header('Location: http://localhost:8888/PHP3/mainPage.php');
        }
        if($display == "yes"){?>
            <form method="post" action="reportDetails.php">
                  <input type="radio" value="renewal" name="togenerate[]"/>
                  Renewal Report<br/>
                  <input type="radio" value="census" name="togenerate[]"/>
                  Census Report<br/>
                  <input type="radio" value="list" name="togenerate[]"/>
                  List of Companies Report<br/>
                  <input type="submit" name="submit" value="Generate"/>
                  <input type="submit" name="back" value="Back"/>
            </form>
         <?php
        }
        }else{
            echo 'You aren\'t logged in! <br>';
            header('Refresh: 2; http://localhost:8888/PHP3/signIn.php');
            echo 'You will be transfered to Sign In page...';
        }
        ?>
    </body>
</html>
